package com.fq.ioc.reflect;

import java.util.Map;

/**
 * @author jifang
 * @since 15/12/31下午4:00
 */
public abstract class ObjectPool {

    private Map<String, Object> pool;

    protected ObjectPool(Map<String, Object> pool) {
        this.pool = pool;
    }

    public synchronized Object getObject(String id) {
        return pool.get(id);
    }

    public synchronized void putObject(String id, Object object) {
        pool.put(id, object);
    }

    public synchronized void clear() {
        pool.clear();
    }
}

